import request from '@/utils/request'

/*
* 土建过程
* */

// 查询 土建过程 列表
export function cqRdcScorePage(query) {
  return request({
    url: '/cq/cqRdcScore/page',
    method: 'get',
    params: query
  })
}

// 复查关联 检查过程列表
export function listRecordsNew(query) {
  return request({
    url: '/cq/cqRdcScore/listRecordsNew',
    method: 'get',
    params: query
  })
}

// 新增土建过程
export function cqRdcScoreAdd(data) {
  return request({
    url: '/cq/cqRdcScore/add',
    method: 'post',
    data: data
  })
}

// 修改土建过程
export function cqRdcScoreEdit(data) {
  return request({
    url: '/cq/cqRdcScore/edit',
    method: 'post',
    data: data
  })
}

// 删除土建过程
export function cqRdcScoreRemove(data) {
  return request({
    url: '/cq/cqRdcScore/remove',
    method: 'post',
    data: data
  })
}
// 强制删除
export function cqRdcScoreForceRemove(data) {
  return request({
    url: '/cq/cqRdcScore/forceRemove',
    method: 'post',
    data: data
  })
}

// 解锁状态
export function cqRdcScoreEnableTask(query) {
  return request({
    url: '/cq/cqRdcScore/enableTask',
    method: 'get',
    params: query
  })
}
// 锁定状态
export function cqRdcScoreDisableTask(query) {
  return request({
    url: '/cq/cqRdcScore/disableTask',
    method: 'get',
    params: query
  })
}

// 导出
export function cqRdcScoreExportReport(query) {
  return request({
    url: '/cq/cqRdcScore/exportRdcRecord',
    method: 'get',
    params: query,
    timeout: 0,
    responseType: 'arraybuffer'
  })
}

// 导出 任务验收情况
export function getProcessWordRecord(query) {
  return request({
    url: '/cq/cqRdcRectifyRecord/getProcessWord',
    method: 'get',
    params: query,
    timeout: 0,
    responseType: 'arraybuffer'
  })
}

// 查询 土建过程  抽检标准内容列表，例：防渗漏、质量、安全、文明等
export function cqRdcScoreItemInfo(query) {
  return request({
    url: '/cq/cqRdcScoreItem/itemInfo',
    method: 'get',
    params: query
  })
}

// 抽检评估结果
export function saveBatchItems(data) {
  return request({
    url: '/cq/cqRdcScoreItem/saveBatchItems',
    method: 'post',
    data: data
  })
}

// 查询 抽检详情接口
export function selectItemDetail(data) {
  return request({
    url: '/cq/cqRdcScoreItem/selectItemDetail',
    method: 'post',
    data: data
  })
}

// 查询 管理动作 抽检详情接口
export function selectGldzItemDetail(data) {
  return request({
    url: '/cq/cqRdcScoreItem/selectGldzItemDetail',
    method: 'post',
    data: data
  })
}

//  根据组织查询项目列表
export function listProByDept(query) {
  return request({
    url: '/gcxt/project/listProByDept',
    method: 'get',
    params: query
  })
}

//  获取有权限的项目列表
export function selectAuthUserProject(query) {
  return request({
    url: '/gcxt/project/selectAuthUserProject',
    method: 'get',
    params: query
  })
}

//  生成随机抽检区域
export function generateRandom(data) {
  return request({
    url: '/cq/cqRdcArea/generateRadom',
    method: 'post',
    data: data
  })
}

//  生成随机抽检区域 新接口
export function generateRandomNew(data) {
  return request({
    url: '/cq/cqRdcArea/generateRadomNew',
    method: 'post',
    data: data
  })
}
//  保存抽检 随机生成区域结果
export function saveRandomResult(data) {
  return request({
    url: '/cq/cqRdcScore/saveRandomResult',
    method: 'post',
    data: data
  })
}

//  根据抽检记录查询抽检区域
export function cqRdcAreaList(query) {
  return request({
    url: '/cq/cqRdcArea/list',
    method: 'get',
    params: query
  })
}

// 删除抽检区域
export function cqRdcAreaBatchDelete(data) {
  return request({
    url: '/cq/cqRdcArea/batchDelete',
    method: 'post',
    data: data
  })
}

//  根据抽检所属项目 查询桩基
export function getPileList(query) {
  return request({
    url: '/cq/cqRdcArea/getPileList',
    method: 'get',
    params: query
  })
}

//  根据抽检记录 查询楼栋
export function getCqBuildingList(data) {
  return request({
    url: '/cq/cqRdcArea/getCqBuildingList',
    method: 'post',
    data: data
  })
}

// 获取抽检记录历史
export function getRandomRecordList(query) {
  return request({
    url: '/cq/cqRdcArea/getRandomRecordList',
    method: 'get',
    params: query
  })
}

//  根据抽检记录 查询楼层
export function getPhysicalFloors(query) {
  return request({
    url: '/mobile/common/getPhysicalFloors',
    method: 'get',
    params: query
  })
}

//  根据抽检记录 查询房间
export function getCqRoomList(query) {
  return request({
    url: '/cq/cqRdcArea/getCqRoomList',
    method: 'get',
    params: query
  })
}

//  获取管理动作得分列表
export function getPreviousGldz(query) {
  return request({
    url: '/cq/cqRdcScore/getPreviousGldz',
    method: 'get',
    params: query
  })
}

// 文件/文件夹列表
export function listRdcTaskFile(query) {
  return request({
    url: '/cq/cqRdcTaskFile/list',
    method: 'get',
    params: query
  })
}
// 添加图片
export function addRdcTaskFile(data) {
  return request({
    url: '/cq/cqRdcTaskFile/add',
    method: 'post',
    data: data
  })
}
// 编辑图片，或重命名文件夹
export function editRdcTaskFile(data) {
  return request({
    url: '/cq/cqRdcTaskFile/edit',
    method: 'post',
    data
  })
}
// 删除图片
export function deleteRdcTaskFile(query) {
  return request({
    url: '/cq/cqRdcTaskFile/delete',
    method: 'get',
    params: query
  })
}

// 根据抽检类型获取文件列表
export function getTaskFileList(query) {
  return request({
    url: '/cq/cqRdcTaskFile/getTaskFileList',
    method: 'get',
    params: query
  })
}

// 获取位置历史信息
export function getTaskRectifyList(query) {
  return request({
    url: '/cq/cqRdcTaskRectify/getTaskRectifyList',
    method: 'get',
    params: query
  })
}

// 获取报表数据
export function getReportPreviewData(query) {
  return request({
    url: '/cq/cqRdcScore/getReportPreviewData',
    method: 'get',
    params: query
  })
}

// 抽检暂存
export function saveTempStorage(data) {
  return request({
    url: '/cq/cqRdcTempStorage/saveTempStorage',
    method: 'post',
    data: data
  })
}
export function getTempStorage(query) {
  return request({
    url: '/cq/cqRdcTempStorage/getTempStorage',
    method: 'get',
    params: query
  })
}

// 管理动作列表
export function cqRdcTaskGldzPage(query) {
  return request({
    url: '/cq/cqRdcTaskGldz/page',
    method: 'get',
    params: query
  })
}
// 合并管理动作
export function mergeGldz(query) {
  return request({
    url: '/cq/cqRdcTaskGldz/mergGldz',
    method: 'get',
    params: query
  })
}
// 拆分管理动作
export function unMergeGldz(query) {
  return request({
    url: '/cq/cqRdcTaskGldz/unMergeGldz',
    method: 'get',
    params: query
  })
}
// 解锁
export function enableGldz(query) {
  return request({
    url: '/cq/cqRdcTaskGldz/enableTask',
    method: 'get',
    params: query
  })
}
// 锁定
export function disableGldz(query) {
  return request({
    url: '/cq/cqRdcTaskGldz/disableTask',
    method: 'get',
    params: query
  })
}

// 获取管理动作报表数据
export function getGldzReportPreviewData(query) {
  return request({
    url: '/cq/cqRdcTaskGldz/getReportPreviewData',
    method: 'get',
    params: query
  })
}

// 导出管理动作报表
export function exportReportGldz(query) {
  return request({
    url: '/cq/cqRdcTaskGldz/exportRdcRecord',
    method: 'get',
    params: query,
    responseType: 'arraybuffer'
  })
}

// 查询问题部位信息集合
export function selectItemAreaInfo(data) {
  return request({
    url: '/cq/cqRdcScoreItem/selectItemAreaInfo',
    method: 'post',
    data: data
  })
}

// 根据 标准计分 获取验收情况列表
export function getScoreItemDetail(query) {
  return request({
    url: '/cq/cqRdcRectifyRecord/getScoreItemDetail',
    method: 'get',
    params: query
  })
}
